/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.ipccenter.toster.jpa;


import java.io.Serializable;
import java.math.BigInteger;
import java.util.Collection;
import javax.persistence.*;

/**
 *
 * @author 7
 */
@Entity
@Table(name = "TEST_TYPES")
@SequenceGenerator(name="seq", sequenceName="p1_seq")
public class JPATestType implements Serializable {
    private static final long serialVersionUID = 1L;
   
    @Column(name = "TYPE_NAME")
    private String typeName;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seq")
    @Column(name = "TYPE_ID")
    private BigInteger typeId;
   
    @Column(name = "TYPE_DESC")
    private String typeDesc;
    @OneToMany(mappedBy = "typeId")
    private Collection<JPATestCase> testcase;

    public JPATestType() {
    }

    public JPATestType(BigInteger typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public BigInteger getTypeId() {
        return typeId;
    }

    public void setTypeId(BigInteger typeId) {
        this.typeId = typeId;
    }

    public String getTypeDesc() {
        return typeDesc;
    }

    public void setTypeDesc(String typeDesc) {
        this.typeDesc = typeDesc;
    }

  
    public Collection<JPATestCase> getTestcase() {
        return testcase;
    }

    public void setTestcase(Collection<JPATestCase> testcase) {
        this.testcase = testcase;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (typeId != null ? typeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JPATestType)) {
            return false;
        }
        JPATestType other = (JPATestType) object;
        if ((this.typeId == null && other.typeId != null) || (this.typeId != null && !this.typeId.equals(other.typeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "toProj.Testtypes[ typeId=" + typeId + " ]";
    }
    
}
